#!/bin/bash
mkdir ./hello-world
cd ./hello-world

cat <<'EOF' > ./Chart.yaml
name: hello-world
version: 1.0.0
EOF

mkdir ./templates

cat <<'EOF' > ./templates/deployment.yaml
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
  name: hello-world
spec:
  replicas: 1
  template:
    metadata:
      labels:
        app: hello-world
    spec:
      containers:
      - name: hello-world
        image:  {{ .Values.image.repository }}:{{ .Values.image.tag }}
        ports:
        - containerPort: 80
          protocol: TCP
EOF
 
cat <<'EOF' > ./templates/service.yaml 
apiVersion: v1
kind: Service
metadata:
  name: hello-world
spec:
  type: NodePort
  ports:
  - port: 80
    targetPort: 80
    protocol: TCP
  selector:
    app: hello-world
EOF

cat <<'EOF' > ./values.yaml
image:
  repository: nginx
  tag: '1.16.1'
EOF

